﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyNhanVien.PresentationLayer
{
    class InterfaceLuongNhanVien:InterfaceBuilder
    {
        public InterfaceLuongNhanVien(QuanLyNhanVien.QuanLyNV ql)
        {
            item = new Item();
            qlNV = new QuanLyNV();
            qlNV = ql;
            nhapNhanVien = new QuanLyNhanVien.PresentationLayer.NhapNhanVien();
            nhapPhongBan = new QuanLyNhanVien.PresentationLayer.NhapPhongBan();
            nhapNghiPhep = new NhapNghiPhep();
        }

        public override void BuildButton()
        {
            ClearButton();

            buttonNV = new Button();
            buttonNV.Name = "NhapNhanVien";
            buttonNV.Text = "Nhập Nhân Viên";
            buttonNV.Enabled = true;
            buttonNV.UseVisualStyleBackColor = true;
            buttonNV.Width = 200;
            buttonNV.Height = 40;
            buttonNV.Location = new System.Drawing.Point(200, 30);
            buttonNV.Click += new EventHandler(NhapNhanVienClick);
            item.listButton.Add(buttonNV);

            buttonNN = new Button();
            buttonNN.Name = "NhapNgayNghi";
            buttonNN.Text = "Nhập Ngay Nghỉ";
            buttonNN.Enabled = true;
            buttonNN.UseVisualStyleBackColor = true;
            buttonNN.Width = 200;
            buttonNN.Height = 40;
            buttonNN.Location = new System.Drawing.Point(500, 30);
            buttonNN.Click += new EventHandler(NhapNgayNghiClick);
            item.listButton.Add(buttonNN);
            //base.BuildButton();
        }

        void NhapNhanVienClick(object sender, EventArgs e)
        {
            
            qlNV.Controls.Remove(nhapNhanVien);
            qlNV.Controls.Remove(nhapPhongBan);
            qlNV.Controls.Remove(nhapNghiPhep);
            nhapNhanVien = new QuanLyNhanVien.PresentationLayer.NhapNhanVien();
            nhapNhanVien.Location = new System.Drawing.Point(11, 70);
            nhapNhanVien.Name = "nhapNhanVien";
            nhapNhanVien.Size = new System.Drawing.Size(878, 600);
            nhapNhanVien.TabIndex = 1;
            qlNV.Controls.Add(nhapNhanVien);
        }

        void NhapNgayNghiClick(object sender, EventArgs e)
        {

            qlNV.Controls.Remove(nhapNhanVien);
            qlNV.Controls.Remove(nhapPhongBan);
            qlNV.Controls.Remove(nhapNghiPhep);
            nhapNghiPhep = new QuanLyNhanVien.PresentationLayer.NhapNghiPhep();
            nhapNghiPhep.Location = new System.Drawing.Point(11, 70);
            nhapNghiPhep.Name = "nhapNgayNghi";
            nhapNghiPhep.Size = new System.Drawing.Size(878, 600);
            nhapNghiPhep.TabIndex = 1;
            qlNV.Controls.Add(nhapNghiPhep);
        }

        public override void BuildBackground()
        {
            item.imageBG = QuanLyNhanVien.Properties.Resources.img;
            //base.BuildBackground();
        }


    }
}
